.class Lcom/xingbook/ui/al;
.super Landroid/webkit/WebViewClient;


# instance fields
.field final synthetic a:Lcom/xingbook/ui/ak;

.field private final synthetic b:Lcom/xingbook/ui/ao;

.field private final synthetic c:Landroid/app/Activity;

.field private final synthetic d:Ljava/lang/String;

.field private final synthetic e:Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/xingbook/ui/ak;Lcom/xingbook/ui/ao;Landroid/app/Activity;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    iput-object p2, p0, Lcom/xingbook/ui/al;->b:Lcom/xingbook/ui/ao;

    iput-object p3, p0, Lcom/xingbook/ui/al;->c:Landroid/app/Activity;

    iput-object p4, p0, Lcom/xingbook/ui/al;->d:Ljava/lang/String;

    iput-object p5, p0, Lcom/xingbook/ui/al;->e:Ljava/lang/String;

    invoke-direct {p0}, Landroid/webkit/WebViewClient;-><init>()V

    return-void
.end method


# virtual methods
.method public onPageFinished(Landroid/webkit/WebView;Ljava/lang/String;)V
    .locals 2

    const-string v0, "http://"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    iget-object v0, v0, Lcom/xingbook/ui/ak;->h:Lcom/xingbook/ui/an;

    const/4 v1, 0x3

    invoke-virtual {v0, v1}, Lcom/xingbook/ui/an;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    :cond_0
    return-void
.end method

.method public onPageStarted(Landroid/webkit/WebView;Ljava/lang/String;Landroid/graphics/Bitmap;)V
    .locals 2

    const-string v0, "http://"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    iget-object v0, v0, Lcom/xingbook/ui/ak;->h:Lcom/xingbook/ui/an;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Lcom/xingbook/ui/an;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    iget-object v0, p0, Lcom/xingbook/ui/al;->d:Ljava/lang/String;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/al;->d:Ljava/lang/String;

    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    iget-object v0, v0, Lcom/xingbook/ui/ak;->g:Lcom/xingbook/ui/t;

    const/4 v1, 0x0

    iput-object v1, v0, Lcom/xingbook/ui/t;->d:Ljava/lang/String;

    :goto_0
    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    iget-object v0, v0, Lcom/xingbook/ui/ak;->g:Lcom/xingbook/ui/t;

    invoke-virtual {v0}, Lcom/xingbook/ui/t;->postInvalidate()V

    :cond_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    iget-object v0, v0, Lcom/xingbook/ui/ak;->g:Lcom/xingbook/ui/t;

    iget-object v1, p0, Lcom/xingbook/ui/al;->e:Ljava/lang/String;

    iput-object v1, v0, Lcom/xingbook/ui/t;->d:Ljava/lang/String;

    goto :goto_0
.end method

.method public onReceivedError(Landroid/webkit/WebView;ILjava/lang/String;Ljava/lang/String;)V
    .locals 4

    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    invoke-static {v0}, Lcom/xingbook/ui/ak;->e(Lcom/xingbook/ui/ak;)Landroid/webkit/WebView;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "<!DOCTYPE html><html><head><meta charset=\"utf-8\"/><title>\u51fa\u9519\u4e86:"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "</title></head><body><p>\u60a8\u6b63\u5728\u8bbf\u95ee\u9519\u8bef\u7684\u5185\u5bb9</p></body><html>"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "text/html; charset=UTF-8"

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v2, v3}, Landroid/webkit/WebView;->loadData(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/xingbook/ui/al;->a:Lcom/xingbook/ui/ak;

    const/4 v1, 0x1

    invoke-static {v0, v1}, Lcom/xingbook/ui/ak;->a(Lcom/xingbook/ui/ak;Z)V

    return-void
.end method

.method public shouldOverrideUrlLoading(Landroid/webkit/WebView;Ljava/lang/String;)Z
    .locals 7

    const/4 v6, 0x1

    const/4 v5, 0x0

    const/4 v1, -0x1

    const-string v0, "http://"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "https://"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    :cond_0
    const-string v0, "#out"

    invoke-virtual {p2, v0}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v0

    if-le v0, v1, :cond_2

    iget-object v1, p0, Lcom/xingbook/ui/al;->b:Lcom/xingbook/ui/ao;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/xingbook/ui/al;->b:Lcom/xingbook/ui/ao;

    invoke-virtual {p2, v5, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lcom/xingbook/ui/ao;->a(Ljava/lang/String;)V

    :cond_1
    :goto_0
    return v6

    :cond_2
    const-string v0, "http://xingbook.com/a/"

    invoke-virtual {p2, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-le v0, v1, :cond_3

    iget-object v0, p0, Lcom/xingbook/ui/al;->b:Lcom/xingbook/ui/ao;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/xingbook/ui/al;->b:Lcom/xingbook/ui/ao;

    const/16 v1, 0x16

    invoke-virtual {p2, v1}, Ljava/lang/String;->charAt(I)C

    move-result v1

    const/16 v2, 0x18

    invoke-virtual {p2, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Lcom/xingbook/ui/ao;->a(CLjava/lang/String;)V

    goto :goto_0

    :cond_3
    invoke-virtual {p1, p2}, Landroid/webkit/WebView;->loadUrl(Ljava/lang/String;)V

    goto :goto_0

    :cond_4
    const-string v0, "tel:"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/xingbook/ui/al;->c:Landroid/app/Activity;

    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.DIAL"

    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    invoke-virtual {v0, v1}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    :cond_5
    const-string v0, "mailto:"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_6

    const-string v0, "mailto:"

    const-string v1, ""

    invoke-virtual {p2, v0, v1}, Ljava/lang/String;->replaceFirst(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.SEND"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-string v2, "plain/text"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v2

    const-string v3, "android.intent.extra.EMAIL"

    new-array v4, v6, [Ljava/lang/String;

    aput-object v0, v4, v5

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[Ljava/lang/String;)Landroid/content/Intent;

    iget-object v0, p0, Lcom/xingbook/ui/al;->c:Landroid/app/Activity;

    invoke-virtual {v0, v1}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    :cond_6
    const-string v0, "geo:"

    invoke-virtual {p2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_7

    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    iget-object v1, p0, Lcom/xingbook/ui/al;->c:Landroid/app/Activity;

    invoke-virtual {v1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    goto/16 :goto_0

    :cond_7
    invoke-virtual {p1, p2}, Landroid/webkit/WebView;->loadUrl(Ljava/lang/String;)V

    goto/16 :goto_0
.end method
